import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [{
        path: '/',
        redirect: '/Login'
    },
    {
        path: '/Login',
        name: 'Login',
        component: () =>
            import ( /* webpackChunkName: "login" */ '@/views/login/Login.vue')
    },
    {
        path: '/Home',
        name: 'Home',
        children: [{
                path: '/publish',
                name: 'publish',
                component: () =>
                    import ( /* webpackChunkName: "publish" */ '@/views/home/publish/publish.vue')
            },
            {
                path: '/publishList',
                name: 'publishList',
                component: () =>
                    import ( /* webpackChunkName: "publishList" */ '@/views/home/publish/publishList.vue')
            },
            {
                path: '/state',
                name: 'state',
                component: () =>
                    import ( /* webpackChunkName: "state" */ '@/views/home/state/state.vue')
            },
            {
                path: '/manager',
                name: 'manager',
                component: () =>
                    import ( /* webpackChunkName: "manager" */ '@/views/home/manager/manager.vue')
            },
        ],
        // route level code-splitting
        // this generates a separate chunk (home.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () =>
            import ( /* webpackChunkName: "home" */ '@/views/home/Home.vue')
    },
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router